package listener;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;

import com.qianfeng.lingshijia.SchoolMarketDetailActivity;

import java.util.List;

/**
 * 学校超市列表选择的监听器
 */
public class OnSchoolMarketItemSelectListener implements AdapterView.OnItemClickListener{

    private List<Integer> marketIdList;
    private Context context;

    public OnSchoolMarketItemSelectListener(List<Integer> marketIdList,Context context) {
        this.marketIdList=marketIdList;
        this.context =context;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Intent intent = new Intent(context, SchoolMarketDetailActivity.class);
        intent.putExtra("schoolMarketId",marketIdList.get(position));
        context.startActivity(intent);
    }
}
